
<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>necrophilia.helpers.Interpolation</title>
<link rel="stylesheet" type="text/css" href="candydoc/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="candydoc/ie56hack.css"><![endif]-->
<script language="JavaScript" src="candydoc/util.js" type="text/javascript"></script>
<script language="JavaScript" src="candydoc/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="candydoc/explorer.js" type="text/javascript"></script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("necrophilia.helpers.Interpolation", "candydoc/");</script>
	<table class="content">
		<tr><td id="docbody"><h1>necrophilia.helpers.Interpolation</h1><!-- Generated by Ddoc from C:\Projects\necrophilia\necrophilia\helpers\Interpolation.d -->
<br><br>

<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">struct 
<span class="currsymbol">Interpolation</span>
<script>explorer.outline.addDecl('Interpolation');</script>

(Time);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Another way of making necrophilia flexible is that the programmer is easily able to choose
	interpolation method wherever interpolation is done. To make it easy and readable
	interpolation is holded in a machine represented by template structure Interpolations.
	The interpolation can be either a delegate or a function. Let's give an example. We would
	like to do nearest interpolation.
<br><br>
<b>Examples:</b><br>
<pre class="d_code">
</pre>
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">alias 
<span class="currsymbol">VecInterpolation</span>
<script>explorer.outline.addDecl('VecInterpolation');</script>

;
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Callback holding vector interpolations
	
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">alias 
<span class="currsymbol">RotInterpolation</span>
<script>explorer.outline.addDecl('RotInterpolation');</script>

;
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Callback holding rot interpolations
	
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">int[] 
<span class="currsymbol">offsets</span>
<script>explorer.outline.addDecl('offsets');</script>

;
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>interpolation 
<span class="currsymbol">offsets</span>
<script>explorer.outline.addDecl('offsets');</script>


<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">interface 
<span class="currsymbol">dynamiclyInterpolated</span>
<script>explorer.outline.addDecl('dynamiclyInterpolated');</script>

(Time);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>Interface for objects with adjastable interpolation method. To set the interpolation method just give a delagete or pointer to a function
	and offsets as the second parameter. What offsets are?
	as we heve our keyframes:
<br><br>
<b>Examples:</b><br>
<pre class="d_code">	[[keyframe 1], [keyframe 2], [keyframe 3] , ... , [keyframe 4]]
</pre>
	one is always the current one, let say
<br><br>
<b>Examples:</b><br>
<pre class="d_code">	[[keyframe 1], [keyframe 2], [keyframe 3] , ... , [keyframe n]]
								/|<font color=red>\</font>
								 |  current
</pre>
	current frame has offset == 0. so in this case, keyframe 1 has offset==-1 . Whats more keyframe n in this case has offset -2.
	What gives us great oportunity. Even if we have 2 keyframe animation we can use interpolations fo 4 keyframes and more
	what will smooth bone transformation. So reasuming. When we call .setInterpolationMethod( &interpolatiomMeth, -1, 0, 1); will mean
	use interpolation method from function interpolationMeth, and as args always give the previous, current and next frame.
<br><br>


<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">setInterpolationMethod</span>
<script>explorer.outline.addDecl('setInterpolationMethod');</script>

(vec3 delegate(Time time, vec3[] vecs...) <span class="funcparam">del</span>);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>setting a delegate as a vec interpolation method
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">setInterpolationMethod</span>
<script>explorer.outline.addDecl('setInterpolationMethod');</script>

(quat delegate(Time time, quat[] vecs...) <span class="funcparam">del</span>);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>setting a delegate as a quat interpolation method
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">setInterpolationMethod</span>
<script>explorer.outline.addDecl('setInterpolationMethod');</script>

(vec3(* <span class="funcparam">func</span>)(Time time, vec3[] vecs...));
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>setting a function as a vec interpolation method 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">setInterpolationMethod</span>
<script>explorer.outline.addDecl('setInterpolationMethod');</script>

(quat(* <span class="funcparam">func</span>)(Time time, quat[] vecs...));
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>setting a function as a quat interpolation method 
<br><br>

</dd>

<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl">void 
<span class="currsymbol">setOffsets</span>
<script>explorer.outline.addDecl('setOffsets');</script>

(int[] <span class="funcparam">offsets</span>...);
</span></dt>
<script>explorer.outline.writeEnabled = false;</script>


<dd>setting <span class="funcparam">offsets</span>
<br><br>

</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</dd>
</dl>
<script>explorer.outline.decSymbolLevel();</script>


</td></tr>
		<tr><td id="docfooter">
			Page was generated with
			<img src="candydoc/img/candydoc.gif" style="vertical-align:middle; position:relative; top:-1px">
			on Wed Mar 21 02:44:07 2007

		</td></tr>
	</table>
</div>
<script>
   explorer.packageExplorer.addModule("necrophilia.Exception");
   explorer.packageExplorer.addModule("necrophilia.Time");
   explorer.packageExplorer.addModule("necrophilia.helpers.Callback");
   explorer.packageExplorer.addModule("necrophilia.helpers.Interpolation");
   explorer.packageExplorer.addModule("necrophilia.helpers.ListArray");
   explorer.packageExplorer.addModule("necrophilia.animation.Base");
   explorer.packageExplorer.addModule("necrophilia.animation.DataNodes");
   explorer.packageExplorer.addModule("necrophilia.animation.Instance");
   explorer.packageExplorer.addModule("necrophilia.animation.Inteligent");
   explorer.packageExplorer.addModule("necrophilia.skeleton.DataNodes");
   explorer.packageExplorer.addModule("necrophilia.skeleton.Bone");
   explorer.packageExplorer.addModule("necrophilia.skeleton.Skeleton");</script>
</body></html>


